//
//  SportConfig.swift
//  LKSportManagerSDK
//
//  Created by KuaiKuai on 2023/8/23.
//

import UIKit

public class SportConfig: NSObject {
    // 配置ID
    var id: String
    // 配置名称
    var code: String
    // 配置名称
    var name: String
    // 心率配置
    var heartRateConfig: SportHeartRateConfig?
    // 运动强度配置
    var intensityConfig: SportIntensityConfig?
    // 运动消耗配置
    var burnConfig: SportBurnConfig?
    init(id: String, code: String, name: String) {
        self.id = id
        self.code = code
        self.name = name
    }
}
struct ValueRangeConfig {
    let min: Int
    let max: Int
}

/**
 心率相关
 */
struct SportHeartRateConfig {
    //区间
    let ranges: [HeartRateRangeConfig]
}
class HeartRateRangeConfig {
    var type: Int = 0
    var quality: Int = 0
    var score: Double = 0
    var values: [ValueRangeConfig] = []
}

/**
 动作强度相关
 */
struct SportIntensityConfig {
    // 区间
    let ranges:[SportIntensityRangeConfig]
}
class SportIntensityRangeConfig {
    // 类型
    var type: Int = 0
    // 质量
    var quality: Int = 0
    // 得分
    var score: Double = 0.0
    // 对应的区间值
    var values: [ValueRangeConfig] = []
}
/**
 运动消耗相关
 */
struct SportBurnConfig {
    //得分
    var score: Double
    // 每秒基础消耗
    var burn: Int
}
enum HeartRateRangeType: Int {
    case none = 0
    case gray = 1
    case blue = 2
    case yellow = 3
    case green = 4
    case orange = 5
    case red = 6
}
enum HeartRateQuality: Int {
    //心率低
    case low = 1
    //心率正常
    case nomal = 2
    //心率高
    case Hight = 3
}
/**
 运动动作相关
 */
enum SportIntensityQuality: Int {
    case none = 0
    case bad = 1
    case good = 2
    case perfect = 3
}
enum SportIntensityType: Int {
    case none = 0
    case bad = 1
    case good = 2
    case perfect = 3
}
